import com.troyworks.util.DesignByContract;
import com.troyworks.util.DesignByContractError;
import com.troyworks.events.EVTD;
/**
 * @author Troy Gardner
 */
class com.troyworks.framework.ui.DebugErrorStatusModalDialog extends MovieClip {

	public var status_txt:TextField;
	
	public function onLoad():Void{
//		trace("DebugErrorStatusModalDialog.onLoad");
		 _visible = DesignByContract.appIsHalted ;
		 status_txt.text ="Fatal Error:\r" + DesignByContract.appHaltMessage;
		var inst:DesignByContract = DesignByContract.getInstance();
		
		inst.addEventListener(DesignByContract.EVTD_ASSERT_FAILED, this, this.onAssertFailed);
		inst.addEventListener(DesignByContract.EVTD_REQUIRE_FAILED, this, this.onRequireFailed);
	}
	public function onAssertFailed(e:Object):Void{
		//_visible = true;
	}
	public function onRequireFailed(e:Object):Void{
	//	trace("DebugErrorStatusModalDialog.onRequireFailed");
		_visible = true;
		status_txt.text = e.msg;

	}
}